package fan.project1_SpeedTalkSystem.Model;

import lombok.Data;

@Data
public class Result<T> {
    private ResponseStatus code;
    private String errMsg;
    private T data;
    public  static<T> Result<T> success(T data){
        Result<T> result = new Result<>();
        result.code = ResponseStatus.SUCCESS;
        result.errMsg = "";
        result.data = data;
        return result;
    }
    public static<T> Result<T> fail(String ErrMsg,T data){
        Result<T> result = new Result<>();
        result.code = ResponseStatus.FAIL;
        result.errMsg = ErrMsg;
        result.data = data;
        return result;
    }
}
